import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
//import tp.Liczba.LiczbaException;

public class LiczbaTest4 {

  private int chosenNumber = 29;
  private Liczba l;
  
  @Test
  public void Decimal_To_Hex_Equals_The_Expected_Result_Returns_True(){
	  String expectedResult = "1D";
	  
	  assertEquals(expectedResult, l.decimalToOtherNumericSystem(chosenNumber, 16));
  }
  
  @Test(expected=java.lang.ArrayIndexOutOfBoundsException.class)
  public void testLiczba_Method_Throws_Exception_Returns_Exception() {
	  l.decimalToOtherNumericSystem(chosenNumber, 999999999);
  }
  
  @Test(timeout=1000)
  public void testLiczba_Method_Does_Not_Time_Out_Returns_True(){
	  l.decimalToOtherNumericSystem(chosenNumber, 8);
  }
  
  @Before
  public void before() {
	  l = new Liczba();
  }
  
  @After
  public void after() {
	  l = null;
  }
  
  
  @Ignore
  public void testDecimal_To_Base_9_Equals_The_Expected_Result_Returns_True() {
	  String expectedResult = "23";
	  
	  assertEquals(expectedResult, l.decimalToOtherNumericSystem(chosenNumber, 9));
  }
  
  @Test
  public void testDecimal_To_Octal_Equals_The_Expected_Result_Returns_True(){
	  String expectedResult = "35";
	  
	  assertEquals(expectedResult, l.decimalToOtherNumericSystem(chosenNumber, 8));
  }
  
  @Test
  public void testDecimal_To_Octal_Equals_The_Expected_Result_Returns_Message(){
	  String expectedResult = "35";
	  
	  assertEquals("You passed",expectedResult, l.decimalToOtherNumericSystem(chosenNumber, 8));
  }
  
  @Test
  public void testLiczba_Instance_Is_Not_Null_Returns_True(){
	  assertNotNull(l);
  }
  
  @Test
  public void testDecimal_To_Octal_The_Expected_Result_Is_True(){
	  String expectedResult = "35";
	  
	  assertTrue(expectedResult.equals(l.decimalToOtherNumericSystem(chosenNumber, 8)));
  }
}